﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace fabao.SqlSugar.Entities
{
    /// <summary>
    /// 自增型id
    /// </summary>
    [Serializable]
    public abstract class Entity<TPrimaryKey> : IEntity<TPrimaryKey>
    {
        /// <summary>
        /// 实体类唯一主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键", IsIdentity = true)]
        public virtual TPrimaryKey id { get; set; }
    }

    /// <summary>
    /// 非自增型id
    /// </summary>
    [Serializable]
    public abstract class EntityNotIdentity<TPrimaryKey> : IEntity<TPrimaryKey>
    {
        /// <summary>
        /// 实体类唯一主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键")]
        public virtual TPrimaryKey id { get; set; }
    }
}
